package com.atguigu.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.atguigu.base.BaseDao;
import com.atguigu.base.BaseService;
import com.atguigu.base.BaseServiceImpl;
import com.atguigu.dao.AdminDao;
import com.atguigu.entity.Admin;
import com.atguigu.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * @author 杨林
 * @create 2022-09-14 23:12 星期三
 * description:
 */
@Service(interfaceClass = AdminService.class)
@Transactional()
public class AdminServiceImpl extends BaseServiceImpl<Admin> implements AdminService {

    @Autowired
    private AdminDao adminDao;

    @Override
    protected BaseDao<Admin> getEntityDao() {
        return adminDao;
    }


    @Override
    public List<Admin> findAll() {
        return adminDao.findAll();
    }


    /**
     * 根据用户名获取admin
     * @param username
     * @return
     */
    @Override
    public Admin getByUsername(String username) {
        return adminDao.getByUsername(username);
    }
}
